Logo
Spacer News Wiki Features F.A.Q. Team members Screenshots Download Messageboard Bug tracker Submit files
Top divider

Lua WeaponDefs

The WeaponDefs[] table holds all information about the weapons used in a mod. Note: Its entries are metatables, so you can't use the pairs() iterator on them, use this instead:

 for id,weaponDef in pairs(WeaponDefs) do
   for name,param in weaponDef:pairs() do
     Spring.Echo(name,param)
   end
 end

Here an example of a weapon table:

 WeaponDefs[3]["accuracy"] = 0,
 WeaponDefs[3]["alwaysVisible"] = false,
 WeaponDefs[3]["areaOfEffect"] = 128,
 WeaponDefs[3]["avoidFriendly"] = false,
 WeaponDefs[3]["beamburst"] = false,
 WeaponDefs[3]["beamtime"] = 1,
 WeaponDefs[3]["beamTTL"] = 1,
 WeaponDefs[3]["beamDecay"] = 1,
 WeaponDefs[3]["bouncerebound"] = 1,
 WeaponDefs[3]["cameraShake"] = 1.5,
 WeaponDefs[3]["canAttackGround"] = true,
 WeaponDefs[3]["cegTag"] = "",
 WeaponDefs[3]["collisionSize"] = 0.050000000745058,
 WeaponDefs[3]["coreThickness"] = 0.25,
 WeaponDefs[3]["coverageRange"] = 0,
 WeaponDefs[3]["cylinderTargetting"] = 0,
 WeaponDefs[3]["damages"] = {
     [1] = 420,
     [2] = 420,
     [3] = 420,
     [4] = 420,
     ...
     -> [ armorType ] = number damage,
     ["paralyzeDamageTime"] = 0,
     ["impulseBoost"] = 0.12300000339746,
     ["impulseFactor"] = 0.12300000339746,
     ["craterBoost"] = 0,
     ["craterMult"] = 0,
   }
 WeaponDefs[3]["dance"] = 0,
 WeaponDefs[3]["description"] = "CruiserDepthCharge",
 WeaponDefs[3]["dropped"] = false,
 WeaponDefs[3]["duration"] = 0.050000000745058,
 WeaponDefs[3]["edgeEffectiveness"] = 0.80000001192093,
 WeaponDefs[3]["energyCost"] = 0,
 WeaponDefs[3]["explosionSpeed"] = 3.233583688736,
 WeaponDefs[3]["exteriorShield"] = false,
 WeaponDefs[3]["filename"] = "TorpedoLauncher",
 WeaponDefs[3]["fireSound"] = {
     [1] = {
       ["id"] = 8,
       ["name"] = "torpedo1.wav",
       ["volume"] = 14.491376876831,
     }
   }
 WeaponDefs[3]["fireStarter"] = 0,
 WeaponDefs[3]["graphicsType"] = -16777216,
 WeaponDefs[3]["gravityAffected"] = false,
 WeaponDefs[3]["groundbounce"] = true,
 WeaponDefs[3]["groundslip"] = 1,
 WeaponDefs[3]["guided"] = true,
 WeaponDefs[3]["hardStop"] = false,
 WeaponDefs[3]["heightBoostFactor"] = -1,
 WeaponDefs[3]["heightMod"] = 0.20000000298023,
 WeaponDefs[3]["hitSound"] = {
     [1] = {
       ["id"] = 9,
       ["name"] = "xplodep2.wav",
       ["volume"] = 28.982753753662,
     }
   }
 WeaponDefs[3]["id"] = 3,
 WeaponDefs[3]["intensity"] = 0.89999997615814,
 WeaponDefs[3]["interceptedByShieldType"] = 0,
 WeaponDefs[3]["interceptor"] = 0,
 WeaponDefs[3]["isShield"] = false,
 WeaponDefs[3]["largeBeamLaser"] = false,
 WeaponDefs[3]["laserFlareSize"] = 15,
 WeaponDefs[3]["leadLimit"] = 1,
 WeaponDefs[3]["leadBonus"] = 1,
 WeaponDefs[3]["manualFire"] = false,
 WeaponDefs[3]["maxAngle"] = 180,
 WeaponDefs[3]["maxVelocity"] = 200,
 WeaponDefs[3]["metalCost"] = 0,
 WeaponDefs[3]["minIntensity"] = 0,
 WeaponDefs[3]["movingAccuracy"] = 0,
 WeaponDefs[3]["name"] = "advdepthcharge",
 WeaponDefs[3]["noAutoTarget"] = false,
 WeaponDefs[3]["noExplode"] = false,
 WeaponDefs[3]["noFeatureCollide"] = false,
 WeaponDefs[3]["noFriendlyCollide"] = true,
 WeaponDefs[3]["noSelfDamage"] = true,
 WeaponDefs[3]["numbounce"] = 1,
 WeaponDefs[3]["onlyForward"] = true,
 WeaponDefs[3]["onlyTargetCategories"] = {
     ["antiflame"] = false,
     ["vtol"] = false,
     ["notland"] = false,
     ["fort"] = false,
     ["special"] = false,
     ["notair"] = false,
     ["kbot"] = false,
     ["antiemg"] = false,
     ["commander"] = false,
     ["jam"] = false,
     ["tport"] = false,
     ["constr"] = false,
     ["strategic"] = false,
     ["kamikaze"] = false,
     ["minelayer"] = false,
     ["hover"] = false,
     ["noweapon"] = false,
     ["plant"] = false,
     ["ship"] = false,
     ["antilaser"] = false,
     ["phib"] = false,
     ["mine"] = false,
     ["notstructure"] = false,
     ["tank"] = false,
     ["mobile"] = false,
     ["underwater"] = false,
     ["antigator"] = false,
     ["notship"] = false,
     ["all"] = false,
     ["notsub"] = false,
     ["weapon"] = false,
   }
 WeaponDefs[3]["paralyzer"] = false,
 WeaponDefs[3]["predictBoost"] = 1,
 WeaponDefs[3]["projectilespeed"] = 6.6666665077209,
 WeaponDefs[3]["proximityPriority"] = 1.0,
 WeaponDefs[3]["range"] = 500,
 WeaponDefs[3]["reload"] = 6,
 WeaponDefs[3]["restTime"] = 0,
 WeaponDefs[3]["salvoDelay"] = 0.10000000149012,
 WeaponDefs[3]["salvoSize"] = 1,
 WeaponDefs[3]["selfExplode"] = true,
 WeaponDefs[3]["selfprop"] = true,
 WeaponDefs[3]["shieldAlpha"] = 0.20000000298023,
 WeaponDefs[3]["shieldBadColorB"] = 0.5,
 WeaponDefs[3]["shieldBadColorG"] = 0.5,
 WeaponDefs[3]["shieldBadColorR"] = 1,
 WeaponDefs[3]["shieldEnergyUse"] = 0,
 WeaponDefs[3]["shieldForce"] = 0,
 WeaponDefs[3]["shieldGoodColorB"] = 1,
 WeaponDefs[3]["shieldGoodColorG"] = 0.5,
 WeaponDefs[3]["shieldGoodColorR"] = 0.5,
 WeaponDefs[3]["shieldInterceptType"] = 0,
 WeaponDefs[3]["shieldMaxSpeed"] = 0,
 WeaponDefs[3]["shieldPower"] = 0,
 WeaponDefs[3]["shieldPowerRegen"] = 0,
 WeaponDefs[3]["shieldPowerRegenEnergy"] = 0,
 WeaponDefs[3]["shieldRadius"] = 0,
 WeaponDefs[3]["shieldRepulser"] = false,
 WeaponDefs[3]["size"] = 3.0499999523163,
 WeaponDefs[3]["sizeGrowth"] = 0.20000000298023,
 WeaponDefs[3]["smartShield"] = false,
 WeaponDefs[3]["soundTrigger"] = false,
 WeaponDefs[3]["sprayAngle"] = 0,
 WeaponDefs[3]["startvelocity"] = 3.6666667461395,
 WeaponDefs[3]["stockpile"] = false,
 WeaponDefs[3]["supplyCost"] = 0,
 WeaponDefs[3]["sweepFire"] = false,
 WeaponDefs[3]["targetBorder"] = 0,
 WeaponDefs[3]["targetMoveError"] = 0,
 WeaponDefs[3]["targetable"] = 0,
 WeaponDefs[3]["tdfId"] = 0,
 WeaponDefs[3]["thickness"] = 2,
 WeaponDefs[3]["tracks"] = true,
 WeaponDefs[3]["trajectoryHeight"] = 0,
 WeaponDefs[3]["turnRate"] = 0.031319729983807,
 WeaponDefs[3]["turret"] = false,
 WeaponDefs[3]["twoPhase"] = false,
 WeaponDefs[3]["type"] = "TorpedoLauncher",
 WeaponDefs[3]["uptime"] = 10,
 WeaponDefs[3]["visibleShield"] = false,
 WeaponDefs[3]["visibleShieldHitFrames"] = 0,
 WeaponDefs[3]["visibleShieldRepulse"] = false,
 WeaponDefs[3]["visuals"] = {
     ["colorR"] = 1,
     ["colorB"] = 0,
     ["colorG"] = 0,
     ["beamWeapon"] = false,
     ["sizeDecay"] = 0,
     ["tileLength"] = 200,
     ["smokeTrail"] = false,
     ["pulseSpeed"] = 1,
     ["renderType"] = 1,
     ["alphaDecay"] = 1,
     ["color2B"] = 1,
     ["separation"] = 1,
     ["scrollSpeed"] = 5,
     ["color2R"] = 1,
     ["modelName"] = "DEPTHCHARGE",
     ["noGap"] = 1,
     ["color2G"] = 1,
     ["stages"] = 5,
   }
 WeaponDefs[3]["vlaunch"] = false,
 WeaponDefs[3]["waterbounce"] = true,
 WeaponDefs[3]["waterWeapon"] = true,
 WeaponDefs[3]["weaponAcceleration"] = 0.016666667535901,
 WeaponDefs[3]["wobble"] = 0,

Retrieved from "http://spring.clan-sy.com/wiki/Lua_WeaponDefs"

This page has been accessed 340 times. This page was last modified 18:52, 18 January 2008.